import java.util.Scanner;

public class Solution {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        //在此输入您的代码...
        int n = scan.nextInt();
        int jige = 0;
        int youxiu = 0;
        for(int i = 0; i <= n; i++) {
            int a = scan.nextInt();
            if(a >= 65) {
                jige++;
            }
            if(a >= 85) {
                youxiu++;
            }
        }
        jige = jige*1000/n;
        youxiu = youxiu*1000/n;
        if(jige % 10 >= 5) {
            jige = jige/10 + 1;
        } else {
            jige = jige / 10;
        }
        if(youxiu % 10 >= 5) {
            youxiu = youxiu/10 + 1;
        } else {
            youxiu = youxiu /10;
        }
        System.out.println(jige+"%");
        System.out.println(youxiu+"%");
        scan.close();
    }
}
